﻿<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!--
        private string POSTBACK_EVENT = "RibbonizedSwordClientClick";
        private string loginForm = @"
";
        private string script = @"
var spShowDialog = function() {
    var div = document.createElement('div');
    div.innerHTML = '<button onclick=""__doPostBack('RibbonizedSwordClientClick')"" />';
    var options = {
        html: div,
        title: 'Deposit via SWORD'
    };
    SP.UI.ModalDialog.showModalDialog(options);
};
ExecuteOrDelayUntilScriptLoaded(spShowDialog, 'sp.js');";

        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Page.Request["__EVENTTARGET"] == POSTBACK_EVENT)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), ClientID, script, true);
                ; // do something
            }
        }

  <CustomAction Id="SwordClientButton" RegistrationType="List" RegistrationId="100" Location="CommandUI.Ribbon.DisplayForm" Rights="ViewListItems">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.ListForm.Display.Manage.Controls._children">
          <Button Id="Ribbon.ListForm.Display.Manage.SwordClientButton" Alt="Deposit via SWORD" Sequence="0" Command="SwordClientClick" LabelText="Deposit via SWORD" TemplateAlias="o1"/>
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler Command="SwordClientClick" CommandAction="javascript:__doPostBack('RibbonizedSwordClientClick')" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
-->
</Elements>
